Skip to content

[clang][modules] Test for llvm#139751 #10661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2025

Conversation

jansvoboda11
Copy link

@jansvoboda11 jansvoboda11 commented May 9, 2025

The input file section in module files only stored files loaded into the SourceManager. When rebuilding the module cache, include-trees also include other files, like the SDKSettings.json file. If we don't invalidate the module cache when that file changes, the corresponding include-trees won't agree with the primary TU include-tree on the file contents. This was fixed in llvm#139751 and this PR adds an include tree test.

I intentionally suppress reporting of this new file in tests, so that I don't have go updating ~all of them. This file is getting reported by the scanning C API, so that the build system is given the ability to eventually act on this file being out-of-date.

rdar://149868539

@jansvoboda11
Copy link
Author

I think the long-term solution is to decouple input files from the SourceManager and have a way to extend the input files written into the PCM with files from the include tree. These are bigger changes that I don't think are reasonable for the upcoming release, so this is just the minimal fix.

@jansvoboda11 jansvoboda11 force-pushed the jan_svoboda/sdk-settings-json-invalidation branch from 3a8d416 to 97afa65 Compare May 13, 2025 21:01
@jansvoboda11 jansvoboda11 changed the title [clang][modules] Detect invalidation of SDKSettings.json [clang][modules] Test for llvm#139751 May 13, 2025
@jansvoboda11
Copy link
Author

Converting this PR into a test-only change - the fix landed upstream as llvm#139751.

@jansvoboda11 jansvoboda11 requested a review from benlangmuir May 13, 2025 22:02
@jansvoboda11 jansvoboda11 merged commit ab4f5af into next May 13, 2025
@jansvoboda11 jansvoboda11 deleted the jan_svoboda/sdk-settings-json-invalidation branch May 13, 2025 22:58
jansvoboda11 added a commit that referenced this pull request May 14, 2025
The input file section in module files only stored files loaded into the `SourceManager`. When rebuilding the module cache, include-trees also include other files, like the SDKSettings.json file. If we don't invalidate the module cache when that file changes, the corresponding include-trees won't agree with the primary TU include-tree on the file contents. This was fixed in llvm#139751 and this PR adds an include tree test.

I intentionally suppress reporting of this new file in tests, so that I don't have go updating ~all of them. This file is getting reported by the scanning C API, so that the build system is given the ability to eventually act on this file being out-of-date.

rdar://149868539
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants